package hr.web;

import com.alibaba.fastjson.JSON;
import hr.mapper.dto.HrDto;
import hr.pojo.UserCompensation;
import hr.service.HrService;
import hr.service.vo.Pager;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by lenovo on 2018/1/29.
 */
@Controller
@RequestMapping("/hr")
public class HrHandler {

    @Resource
    private HrService hrService;

    @GetMapping("/search")
    @ResponseBody
    public String list(Integer offset,Integer limit,HrDto dto,Model model){
        Pager list = hrService.findUCommAll(offset,limit,dto);
        String json = JSON.toJSONString(list);
        return json;
    }

    @GetMapping("/xlist")
    public String xlist(){
        return "xin/xlist";
    }


}
